package com.bawei.homegroup.model;



import com.bawei.homegroup.Api;
import com.bawei.mvvmcomm.mvvm.model.BaseModel;
import com.bawei.networkmoudle.ChangeFunction;
import com.bawei.networkmoudle.Entity.BaseEntity;
import com.bawei.networkmoudle.HttpFactory;
import com.bawei.networkmoudle.HttpType;

import java.util.Map;

import io.reactivex.Observable;

public class HomeValueModel extends BaseModel {

    public Observable<BaseEntity>requestAddCar(Map<String,Object>map){
        return HttpFactory.getInstance().factory(HttpType.TOKEN)
                .getRetrofit().create(Api.class)
                .requestAddCar(createBody(map));
    }

    public Observable<BaseEntity>requestGoods(Map<String,Object>map){
        return HttpFactory.getInstance().factory(HttpType.TOKENSIGNTYPE)
                .getRetrofit().create(Api.class)
                .requestHomeGoods(createBody(map))
                .map(new ChangeFunction());
    }

}